package com.student.model;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * ClassMessage entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Class_Message", schema = "dbo", catalog = "StudentManager")
public class ClassMessage implements java.io.Serializable {

	// Fields

	private Long classMessageId;
	private ClassInfo classInfo;
	private Timestamp classMessageTime;
	private String classMessageConent;
	private String messager;

	// Constructors

	/** default constructor */
	public ClassMessage() {
	}

	/** minimal constructor */
	public ClassMessage(Long classMessageId, String classMessageConent,
			String messager) {
		this.classMessageId = classMessageId;
		this.classMessageConent = classMessageConent;
		this.messager = messager;
	}

	/** full constructor */
	public ClassMessage(Long classMessageId, ClassInfo classInfo,
			Timestamp classMessageTime, String classMessageConent,
			String messager) {
		this.classMessageId = classMessageId;
		this.classInfo = classInfo;
		this.classMessageTime = classMessageTime;
		this.classMessageConent = classMessageConent;
		this.messager = messager;
	}

	// Property accessors
	@Id
	@Column(name = "Class_Message_id", unique = true, nullable = false, precision = 18, scale = 0)
	@GeneratedValue
	public Long getClassMessageId() {
		return this.classMessageId;
	}

	public void setClassMessageId(Long classMessageId) {
		this.classMessageId = classMessageId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "Class_id")
	public ClassInfo getClassInfo() {
		return this.classInfo;
	}

	public void setClassInfo(ClassInfo classInfo) {
		this.classInfo = classInfo;
	}

	@Column(name = "Class_Message_Time", length = 23)
	public Timestamp getClassMessageTime() {
		return this.classMessageTime;
	}

	public void setClassMessageTime(Timestamp classMessageTime) {
		this.classMessageTime = classMessageTime;
	}

	@Column(name = "Class_Message_Conent", nullable = false)
	public String getClassMessageConent() {
		return this.classMessageConent;
	}

	public void setClassMessageConent(String classMessageConent) {
		this.classMessageConent = classMessageConent;
	}

	@Column(name = "Messager", nullable = false, length = 20)
	public String getMessager() {
		return this.messager;
	}

	public void setMessager(String messager) {
		this.messager = messager;
	}

}